package com.servlet;

import com.service.UserService;
import com.service.impl.UserServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;
import java.io.PrintWriter;

/**
 * 用户登录
 * @author wang_
 * @version 2024.3.4.1
 * @description
 * @date 2025/7/11
 */
@WebServlet("/LogonServlet")
public class LogonServlet extends AbstractHttpServlet {
	@Override
	public void doHandle(HttpServletRequest request, HttpServletResponse response, PrintWriter out, HttpSession session) throws IOException, ServletException {
		switch (request.getParameter("type")) {
//			登录
			case "login" -> login(request, out, session);
		}
	}
	
	private void login(HttpServletRequest request, PrintWriter out, HttpSession session) {
//		UserDetailed userDetailed = userService.getUserDetailed(Integer.parseInt(request.getParameter("account")), request.getParameter("password"));
//		if (userDetailed != null) {
//			session.setAttribute("userDetailed", userDetailed);
//			out.print("登录成功！");
//		}
	}
}
